const express = require("express");
const { register } = require("../../authController.cjs");
var route = express.Router();

route.post("/register", async (req, res) => {
  const user = req.body.user;
  const result = await register(user);
  console.log(result);
  if (result.ok) {
    res.status(200).json(result);
  } else {
    res.status(500).json(result);
  }
});

module.exports = route;
